<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../node_modules/axios/dist/axios.min.js"></script>
</head>
<body>
    <button>获取</button>
    <button>添加</button>
   
    <script>
        let btn = document.querySelectorAll('button')
        let localserveraxios = axios.create({
            method:'get',
            baseURL:' http://api.liu.com:3000',
            headers:{
                a:999
            },
            params:{
                sex:'abcd'
            }
        })

        btn[0].addEventListener('click', ()=>{
            localserveraxios('/movie',{
                method:'post',
                data:{
                    name:'满江红',
                    decrecter:'张艺谋',
                    star:'张译'
                }
            })
        
            btn[0].addEventListener('click', ()=>{
            localserveraxios('/movie')
                
            })    

        })

        
    </script>

</body>
</html>